import base64

import numpy as np
from modules.input_reader import VideoReader, ImageReader
from argparse import ArgumentParser

if __name__ == '__main__':
    # a = np.arange(9, dtype=np.int_).reshape(3, 3)
    # print('第一个数组：')
    # print(a)
    # print('\n')
    # print('第二个数组：')
    # b = np.arange(10, 19, dtype=np.int_).reshape(3, 3)
    # print(b)
    # print('\n')
    # print('两个数组相加：')
    # print(np.add(a, b))
    # print('\n')
    # print('两个数组相减：')
    # print(np.subtract(a, b))
    # print(np.float32(1))

    # print('\n')
    # print('两个数组相乘：')
    # print(np.multiply(a, b))
    # print('\n')
    # print('两个数组相除：')
    # print(np.divide(a, b))

    # parser = ArgumentParser()
    # parser.add_argument('--images', help='Optional. Path to input image(s).', nargs='+', default='')
    # args = parser.parse_args()
    # print(args.images)
    # print(type(args.images))
    # frame_provider = ImageReader(['1.jpg', '2.jpg'])
    # for i in frame_provider:
    #     print(1)

    f = open(r'test.jpg', 'rb')  # 二进制方式打开图文件
    ls_f = base64.b64encode(f.read())  # 读取文件内容，转换为base64编码
    print(ls_f)
    imagedata = base64.b64decode(ls_f)  # 解码

    file = open('tmp.jpg', "wb")
    file.write(imagedata)
    f.close()